#include <iostream>


class Building1 {
    // GoodGay 是本类的好朋友，可以访问本类中的私有成员
    friend class GoodGay;
public:
    std::string sittingRoom; // 客厅

    Building1();

private:
    std::string bedRoom; // 卧室

};

// 类外写成员函数
Building1::Building1() {
    this->bedRoom = "卧室";
    this->sittingRoom = "客厅";
}


class GoodGay {
public:
    Building1 *building;
    GoodGay();
    void visit(); // 参观函数 访问Building中的属性


};

GoodGay::GoodGay() {
    building = new Building1();
}

void GoodGay::visit() {
    std::cout << building->sittingRoom << std::endl;
    std::cout << building->bedRoom << std::endl;
}



void test01() {
    GoodGay goodGay;
    goodGay.visit();
}

int main() {
    test01();
    return 0;
}

